<?php
class Config {
    var $configDom;

    function Config() {
		global $dgConfigFile;
		$sxe = simplexml_load_file( $dgConfigFile );
		if ($sxe === false) {
			throw new Exception("Error while parsing the document[$xmlFile], $php_errormsg");
		}

		$this->configDom = simplexml_import_dom($sxe);
    }

	public function getConfig() {
        return $this->configDom;
	}

    public function getRepoPath($serviceId, $repoId) {
        $xpath="//service[@id='$serviceId']/repo/path[@id='$repoId']";
        $repo = $this->configDom->xpath($xpath);
        return $repo[0];
    }
}

$dgConfig = new Config();
$dgConfigDom = $dgConfig->getConfig();

$extEnscript = array
(
  '.ada'    => 'ada',
  '.adb'    => 'ada',
  '.ads'    => 'ada',
  '.awk'    => 'awk',
  '.c'     => 'c',
  '.c++'    => 'cpp',
  '.cc'    => 'cpp',
  '.cpp'    => 'cpp',
  '.csh'    => 'csh',
  '.cxx'    => 'cpp',
  '.diff'   => 'diffu',
  '.dpr'    => 'delphi',
  '.e'     => 'eiffel',
  '.el'    => 'elisp',
  '.eps'    => 'postscript',
  '.f'     => 'fortran',
  '.for'    => 'fortran',
  '.gs'    => 'haskell',
  '.h'     => 'c',
  '.hpp'    => 'cpp',
  '.hs'    => 'haskell',
  '.htm'    => 'html',
  '.html'   => 'html',
  '.idl'    => 'idl',
  '.java'   => 'java 5',
  '.js'    => 'javascript',
  '.lgs'    => 'haskell',
  '.lhs'    => 'haskell',
  '.m'     => 'objc',
  '.m4'    => 'm4',
  '.man'    => 'nroff',
  '.nr'    => 'nroff',
  '.p'     => 'pascal',
  '.pas'    => 'delphi',
  '.patch'  => 'diffu',
  '.pkg'    => 'sql',
  '.pl'    => 'perl',
  '.pm'    => 'perl',
  '.pp'    => 'pascal',
  '.ps'    => 'postscript',
  '.s'     => 'asm',
  '.scheme'  => 'scheme',
  '.scm'    => 'scheme',
  '.scr'    => 'synopsys',
  '.sh'    => 'bash',
  '.shtml'  => 'html',
  '.sql'    => 'sql',
  '.st'    => 'states',
  '.syn'    => 'synopsys',
  '.synth'  => 'synopsys',
  '.tcl'    => 'tcl',
  '.tex'    => 'tex',
  '.texi'   => 'tex',
  '.texinfo' => 'tex',
  '.v'     => 'verilog',
  '.vba'    => 'vba',
  '.vh'    => 'verilog',
  '.vhd'    => 'vhdl',
  '.vhdl'   => 'vhdl',
  '.py'    => 'python',
  '.php'    => 'php',
  '.phtml'  => 'php',
  '.php3'   => 'php',
  '.php'    => 'php',
  '.xml'    => 'xml'
);

?>
